package com.suzus.medicineGraph.dao;

import com.suzus.medicineGraph.model.Symptom;
import org.neo4j.driver.internal.value.PathValue;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface SymptomRepository extends Neo4jRepository<Symptom,Long> {
    @Query("MATCH p = ()-[:治疗]->({name: $to}) return p")
    ArrayList<PathValue> querySymptomRelation(@Param("to") String to);

    @Query("MATCH (p:Symptom {name: $from}) return p")
    Symptom querySymptom(@Param("from") String from);

    @Query("MATCH p=()-[]-() return p")
    ArrayList<PathValue> queryRelation(String values);

}
